<?
class ItemSameCategoryForm extends Form{
	function ItemSameCategoryForm(){
		Form::Form('ItemSameCategoryForm');
        $this->link_js('javascript/jquery/jquery.jcache.js');
		$this->link_js('javascript/ajax.js');

	}
	
	function draw()
	{
		$p_item_same = (int)Url::get('p_item_same',1);
		
		echo '<div id="item_same_cat"><center><img id="loading_item_same_cat" style="display:none;margin:10px 0" src="style/images/loading.gif" /></center></div>
				<script>
				jQuery(document).ready(function(){
					document.getElementById("loading_item_same_cat").style.display = "";
					jQuery.ajax({
						type: "GET",
						url: "' . WEB_DIR . 'ajax.php?act=item&code=item_same_category&category_id='.CGlobal::$curCategory.'",
						data: "p_item_same='.$p_item_same.'&item_id='.Item::$item['id'].'",
						success: function(data)
						{
							if(data != "")
							{						
								document.getElementById("loading_item_same_cat").style.display = "none";
							
								document.getElementById("item_same_cat").innerHTML = data;
							}
							else
							{
								jQuery("#item_same_cat").hide();
							}			
						}						
					});
				});
		</script>';			
	}		
} 	
?>